Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 freezeOnOffscreen render config #297

Merged
merged 11 commits into from
Aug 28, 2024
Merged

Conversation

theashraf
Copy link
Member

@theashraf theashraf commented Jul 20, 2024

Related to #277

changes:
Introduce freezeOnOffscreen render configuration for:

  • DotLottie
  • DotLottieWorker

This auto freezes and unfreezes the animation when it's offscreen and not visible to the user, saving resources by stopping the animation loop when it's not in view.

Copy link

changeset-bot bot commented Jul 20, 2024

🦋 Changeset detected

Latest commit: bfb1891

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@lottiefiles/dotlottie-web Minor
@lottiefiles/dotlottie-react Patch
@lottiefiles/dotlottie-solid Patch
@lottiefiles/dotlottie-svelte Patch
@lottiefiles/dotlottie-vue Patch
@lottiefiles/dotlottie-wc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jul 20, 2024

Coverage Report for @lottiefiles/dotlottie-web (packages/web)

Status Category Percentage Covered / Total
🟢 Lines 54.6% / 30% 540 / 989
🟢 Statements 53.27% / 30% 562 / 1055
🟢 Functions 55.42% / 30% 143 / 258
🟢 Branches 58.62% / 30% 367 / 626
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/web/src/dotlottie.ts 72.65% 64.95% 69.76% 75.4% 134, 138-141, 166, 207-209, 211, 246, 254, 299, 322, 326, 407, 423, 427, 456, 471-472, 487, 509-512, 545, 550, 560, 588, 588, 590-593, 597, 602-605, 612, 612, 614-617, 621, 621, 623-626, 693, 693, 695-698, 702, 752, 779, 783, 793, 803, 803, 805-811, 815, 825, 829, 831-833, 832, 835, 839, 841-843, 842, 845, 849-851, 853-855, 857-860, 864, 866, 870, 872, 876, 878, 882, 884, 888, 890, 894, 903, 905-911, 906-911, 908-911, 910, 913, 917, 917, 919, 921, 923-925, 923-924, 927, 931-957, 932, 934-936, 935, 938-940, 939, 942-944, 943, 946-948, 947, 950-952, 951, 954-956, 955, 972, 976-977, 979-982, 986, 990, 994
packages/web/src/offscreen-observer.ts 100% 90% 100% 100%
packages/web/src/utils.ts 100% 85% 100% 100%
packages/web/src/worker/dotlottie.ts 63.02% 62.01% 70.27% 68.62% 14, 243, 261, 322, 382, 387, 394, 401, 401, 403-404, 408, 422, 422, 424-425, 429, 461, 461, 463-464, 468, 478, 485, 485, 487-488, 492, 492, 494, 496-497, 518, 525, 532, 532, 534-535, 539, 546, 546, 548-549, 565, 572, 582, 609, 633, 633, 635, 637, 639, 643, 643, 645, 647, 649, 653, 653, 655, 657, 659, 661, 665, 665, 667, 669, 673, 673, 675, 679, 679, 681, 685-687, 689-691, 693-696, 700, 702, 706, 708, 712, 714, 718, 720, 724, 726, 730, 734-760, 735, 737-739, 738, 741-743, 742, 745-747, 746, 749-751, 750, 753-755, 754, 757-759, 758
Generated in workflow #1274

Copy link
Contributor

github-actions bot commented Jul 20, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
@lottiefiles/dotlottie-web 38.45 KB (+2.51% 🔺) 770 ms (+2.51% 🔺) 2.9 s (+156.12% 🔺) 3.7 s
@lottiefiles/dotlottie-web WASM 386.62 KB (0%) 7.8 s (0%) 0 ms (+100% 🔺) 7.8 s
@lottiefiles/dotlottie-react 42.12 KB (+1.79% 🔺) 843 ms (+1.79% 🔺) 1.7 s (-8.41% 🔽) 2.5 s
@lottiefiles/dotlottie-vue 45.43 KB (+1.91% 🔺) 909 ms (+1.91% 🔺) 3.1 s (+39.91% 🔺) 4 s
@lottiefiles/dotlottie-wc 45.83 KB (+2.07% 🔺) 917 ms (+2.07% 🔺) 2 s (+14.96% 🔺) 2.9 s
@lottiefiles/dotlottie-svelte 46.32 KB (+1.96% 🔺) 927 ms (+1.96% 🔺) 1.6 s (+17.79% 🔺) 2.5 s
@lottiefiles/dotlottie-solid 45.21 KB (+1.94% 🔺) 905 ms (+1.94% 🔺) 1.1 s (-21.42% 🔽) 2 s

@theashraf theashraf requested review from afsalz and removed request for afsalz July 20, 2024 11:11
@theashraf theashraf marked this pull request as ready for review August 27, 2024 04:32
@theashraf theashraf self-assigned this Aug 27, 2024
@theashraf theashraf added the enhancement New feature or request label Aug 27, 2024
Copy link
Collaborator

@afsalz afsalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good 👍🏽

@theashraf theashraf merged commit b7148b9 into main Aug 28, 2024
4 checks passed
@theashraf theashraf deleted the feat/freeze-on-offscreen branch August 28, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants